import random
# 创建学生
i = 1
students = []
while i <= 30:
    students.append("学生%d" % i)
    i += 1
# 创建老师
i = 1
teacher = []
while i <= 5:
    teacher.append("教师%d" % i)
    i += 1
# 创建教室
classes = [[], [], [], [], []]
# 分配学生
max = int(len(students) / len(classes))
for student in students:
    i = random.randint(0, 4)
    classes[i].append(student)
# 打乱教师
random.shuffle(teacher)
# 输出结果
class_id = 0
for c in classes:
    print("教室%d:%s,学生为%s" % (class_id+1, teacher[class_id], c))
    class_id += 1
